package org.ccams.dao;

import java.util.List;


import org.ccams.domain.TOrdertype;
import org.ccams.util.PageParameter;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class TOrdertypeDAO extends SqlMapClientDaoSupport {

    
    public TOrdertypeDAO() {
        super();
    }

   
    public int insert(TOrdertype record) {
        return (Integer)getSqlMapClientTemplate().update("t_ordertype.abatorgenerated_insert", record);
    }

   
    public int updateByPrimaryKey(TOrdertype record) {
        int rows = getSqlMapClientTemplate().update("t_ordertype.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

  
    public int updateByPrimaryKeySelective(TOrdertype record) {
        int rows = getSqlMapClientTemplate().update("t_ordertype.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

   
    public TOrdertype selectByPrimaryKey(Integer idtOrdertype) {
        TOrdertype key = new TOrdertype();
        key.setIdtOrdertype(idtOrdertype);
        TOrdertype record = (TOrdertype) getSqlMapClientTemplate().queryForObject("t_ordertype.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

   
    public int deleteByPrimaryKey(Integer idtOrdertype) {
        TOrdertype key = new TOrdertype();
        key.setIdtOrdertype(idtOrdertype);
        int rows = getSqlMapClientTemplate().delete("t_ordertype.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }
    /**
	 * 返回指定页码的角色
	 * @return
	 */
	@SuppressWarnings({ "unchecked", "deprecation" })
	public  List<TOrdertype> getOrdertype(PageParameter page){		
		return getSqlMapClientTemplate().queryForList("t_ordertype.getByPage", page);
	}
	/**
	 * 返回记录总数
	 * @return
	 */
	public int getCount(){
		return (Integer)getSqlMapClientTemplate().queryForObject("t_ordertype.getCount");
	}
	 /**
	 * 返回所有
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public  List<TOrdertype> getAll(){		
		return getSqlMapClientTemplate().queryForList("t_ordertype.getAll");
	}
}